package org.raymond.iworks.study.basic.designpattern.iterator;

import java.util.Iterator;
import java.util.List;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
public class InfoCollegeIterator implements Iterator {
    List<Department> departmentList;
    int idx = 0;

    public InfoCollegeIterator(List<Department> departmentList) {
        this.departmentList = departmentList;
    }

    @Override
    public boolean hasNext() {
        if(idx>departmentList.size()-1){
            return false;
        }else {
            return true;
        }
    }

    @Override
    public Object next() {
        Department department = departmentList.get(idx);
        idx++;
        return department;
    }

    @Override
    public void remove() {
    }
}
